package com.monitor.search;

import com.monitor.model.SysOperLog;
import com.monitor.pubInter.BaseSearch;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;
import java.util.List;
/**
*   @author afeng
*   @Date 2025-03-17 10:50:14
*   @description SysOperLogSearch      操作日志记录
*/


@Data
@ApiModel("操作日志记录SysOperLogSearch")
public abstract class SysOperLogSearch<Sub extends SysOperLogSearch<Sub>> extends BaseSearch {
    @ApiModelProperty(value = "模块标题")
    private String titleLike;
    @ApiModelProperty(value = "业务类型 0:其它:OTHER,1:新增:INSERT,2:修改:UPDATE,3:删除:DELETE,4:授权:GRANT,5:导出:EXPORT,6:导入:IMPORT,7:强退:FORCE,8:生成代码:GENCODE,9:清空:CLEAN,10:详情:detail,11:列表:list,12:查询:query")
    private List businessTypeIn;
    @ApiModelProperty(value = "方法名称")
    private String methodLike;
    @ApiModelProperty(value = "操作类别 0:其它:OTHER,1:后台用户:MANAGE,2:手机端用户:MOBILE")
    private List operatorTypeIn;
    @ApiModelProperty(value = "操作人员")
    private String operNameLike;
    @ApiModelProperty(value = "部门名称")
    private String deptNameLike;
    @ApiModelProperty(value = "请求URL")
    private String operUrlLike;
    @ApiModelProperty(value = "主机地址")
    private String operIpLike;
    @ApiModelProperty(value = "操作地点")
    private String operLocationLike;
    @ApiModelProperty(value = "操作状态（0正常 1异常）")
    private List statusIn;
    @ApiModelProperty(value = "开始操作时间")
    private Date operTimeStart;
    @ApiModelProperty(value = "结束操作时间")
    private Date operTimeEnd;
    @ApiModelProperty(value = "大于排序")
    private Integer sortNumGreater;
    @ApiModelProperty(value = "小于排序")
    private Integer sortNumLess;
    @ApiModelProperty(value = "是否显示 1:是:Y,0:否:N")
    private List showFlagIn;
    @ApiModelProperty(value = "是否删除 1:删除:Y,0:正常:N")
    private Integer delFlagEq=0;

    public SysOperLogSearch() {
        setDelFlagEq(0);
    }



    /**
    * 返回子类Sub
    * @return
    */
    public abstract Sub getSubThis();

    @Override
    public String createTimeFiled() {
        return SysOperLog.CREATE_TIME;
    }
    @Override
    public String updateTimeFiled() {
        return SysOperLog.UPDATE_TIME;
    }
    @Override
    public String  setDefaultField() {
        return SysOperLog.CREATE_TIME;
    }
    @Override
    public String pkField() {
        return SysOperLog.ID;
    }

    @Override
    public String  toString() {
        return "SysOperLogSearch{}"+super.toString();
    }
    public Sub setTitleLike(String titleLike){
        this.titleLike = titleLike;
        setLikeField(SysOperLog.TITLE, titleLike);
        return getSubThis();
    }
    public Sub setBusinessTypeIn(List businessTypeIn){
        this.businessTypeIn = businessTypeIn;
        setInField(SysOperLog.BUSINESS_TYPE, businessTypeIn);
        return getSubThis();
    }
    public Sub setMethodLike(String methodLike){
        this.methodLike = methodLike;
        setLikeField(SysOperLog.METHOD, methodLike);
        return getSubThis();
    }
    public Sub setOperatorTypeIn(List operatorTypeIn){
        this.operatorTypeIn = operatorTypeIn;
        setInField(SysOperLog.OPERATOR_TYPE, operatorTypeIn);
        return getSubThis();
    }
    public Sub setOperNameLike(String operNameLike){
        this.operNameLike = operNameLike;
        setLikeField(SysOperLog.OPER_NAME, operNameLike);
        return getSubThis();
    }
    public Sub setDeptNameLike(String deptNameLike){
        this.deptNameLike = deptNameLike;
        setLikeField(SysOperLog.DEPT_NAME, deptNameLike);
        return getSubThis();
    }
    public Sub setOperUrlLike(String operUrlLike){
        this.operUrlLike = operUrlLike;
        setLikeField(SysOperLog.OPER_URL, operUrlLike);
        return getSubThis();
    }
    public Sub setOperIpLike(String operIpLike){
        this.operIpLike = operIpLike;
        setLikeField(SysOperLog.OPER_IP, operIpLike);
        return getSubThis();
    }
    public Sub setOperLocationLike(String operLocationLike){
        this.operLocationLike = operLocationLike;
        setLikeField(SysOperLog.OPER_LOCATION, operLocationLike);
        return getSubThis();
    }
    public Sub setStatusIn(List statusIn){
        this.statusIn = statusIn;
        setInField(SysOperLog.STATUS, statusIn);
        return getSubThis();
    }
    public Sub setOperTimeStart(Date operTimeStart){
        this.operTimeStart = operTimeStart;
        setDateStartField(SysOperLog.OPER_TIME, operTimeStart);
        return getSubThis();
    }
    public Sub setOperTimeEnd(Date operTimeEnd){
        this.operTimeEnd = operTimeEnd;
        setDateEndField(SysOperLog.OPER_TIME, operTimeEnd);
        return getSubThis();
    }
    public Sub setSortNumGreater(Integer sortNumGreater){
        this.sortNumGreater = sortNumGreater;
        setGreaterField(SysOperLog.SORT_NUM, sortNumGreater);
        return getSubThis();
    }
    public Sub setSortNumLess(Integer sortNumLess){
        this.sortNumLess = sortNumLess;
        setLessField(SysOperLog.SORT_NUM, sortNumLess);
        return getSubThis();
    }
    public Sub setShowFlagIn(List showFlagIn){
        this.showFlagIn = showFlagIn;
        setInField(SysOperLog.SHOW_FLAG, showFlagIn);
        return getSubThis();
    }
    public Sub setDelFlagEq(Integer delFlagEq){
        this.delFlagEq = delFlagEq;
        setEqualField(SysOperLog.DEL_FLAG, String.valueOf(delFlagEq));
        return getSubThis();
    }
}